<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>tooltipster插件使用-方法的使用</title>
        <link rel="stylesheet" href="css/tooltipster.bundle.css" />
    </head>
    <body>
        <span id="my-tooltip" class="tooltip" title="This is my span's tooltip message!">我的提示框</span>
        <div id="my-other-tooltip">我的另一个提示框</div>
        <span class="tooltip" title="This is my span's tooltip message!">tooltip2</span>
        <button id="closeAllTooltips">关闭所有的提示框</button>
        <script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
        <script src="../fastclick/fastclick.js"></script>
        <script src="js/tooltipster.bundle.min.js"></script>
        <script>
        // initialize your tooltip as usual:
        // $('.tooltip').tooltipster({});
        // // at some point you may decide to update its content:
        // $('#my-tooltip').tooltipster('content', 'My new content');
        // // ...and open it:
        // $('#my-tooltip').tooltipster('open');

        // NOTE: most methods are actually chainable, as you would expect them to be:
        // 链式调用
        // $('#my-other-tooltip')
        //     .tooltipster({})
        //     .tooltipster('content', 'My new content')
        //     .tooltipster('open');
        //在调用之前更新提示框内容
        $('#my-other-tooltip').tooltipster({
            functionBefore: function(instance, helper) {
                instance.content('functionBefore：My new content');
            }
        });
        </script>
    </body>
</html>